package com.atgm.mall.gmmailmember.controller;

import com.atgm.common.utils.R;
import com.atgm.mall.gmmailmember.entity.MemberThumbsReplyEntity;
import com.atgm.mall.gmmailmember.service.MemberThumbsReplyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("gmmallmember/memberthumbsreply")
public class MemberThumbsReplyController {

    @Autowired
    private MemberThumbsReplyService memberThumbsReplyService;

    @PostMapping("saveThumbsReply")
    public R saveThumbsReply(@RequestBody MemberThumbsReplyEntity memberThumbsReplyEntity) {
        Integer flag = memberThumbsReplyService.saveThumbsReplyInfo(memberThumbsReplyEntity);
        return R.ok().setData(flag);
    }

    @GetMapping("/getThumbsReplyIds/{memberId}/{articleId}")
    public R getThumbsReplyIds(@PathVariable("memberId") Long memberId, @PathVariable("articleId") Long articleId) {
        List<Long> list = memberThumbsReplyService.queryThumbsReplyIds(memberId, articleId);
        return R.ok().setData(list);
    }

}
